package com.ishowcode.Service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class MQReceiver {
//    @Resource
//    private RabbitTemplate rabbitTemplate;
    //接受消息
    @RabbitListener(queues = "queue1")
    public void receive1(Object msg){
        log.info("queue1接收到消息-->"+msg);
    }
    @RabbitListener(queues = "direct1")
    public void queue_direct1(Object msg){
        log.info("direct1接收到消息-->"+msg);
    }
    @RabbitListener(queues = "direct2")
    public void queue_direct2(Object msg){
        log.info("direct2接收到消息-->"+msg);
    }

}
